<?php
namespace App\Library\System;

class Cache
{
    private static $static_cache;
    public $memory;

    private function __construct()
    {
        $this->memory = new Memcache;
    }

    public static function getInstance()
    {
        if (!self::$static_cache) {
            self::$static_cache = new Cache();
        }

        return self::$static_cache;
    }

    public function set($key, $value)
    {
        $this->memory->set($key, $value);
    }

    public function get($key)
    {
        return $this->memory->get($key);
    }

    public function __destruct()
    {

    }

}